package cn.wolfcode.feign;

import cn.wolfcode.common.web.Result;
import cn.wolfcode.domain.PayVo;
import cn.wolfcode.domain.RefundVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

@FeignClient(name = "pay-service")
public interface AlipayFeignApi {

    /**
     * 远程调用支付宝支付操作
     * 远程调用的参数
     * 是对象或map贴@RequestBody注解
     * 不是对象贴@RequestParam注解
     * @param payVo
     * @return
     */
    @RequestMapping("/alipay/payOnline")
    Result<String> payOnline(@RequestBody PayVo payVo);

    /**
     * 调用SDK验证签名
     * @param params
     * @return
     */
    @RequestMapping("/alipay/checkSign")
    Result<Boolean> checkSign(@RequestBody Map<String, String> params);

    /**
     * 支付宝在线退款
     * @param refundVo
     * @return
     */
    @RequestMapping("/alipay/refundOnline")
    Result<Boolean> refundOnline(@RequestBody RefundVo refundVo);
}
